#include "widget.h"
#include "ui_widget.h"
#include <QButtonGroup>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // 使用QButtonGroup进行分组
    QButtonGroup* g1 = new QButtonGroup(this);
    QButtonGroup* g2 = new QButtonGroup(this);
    QButtonGroup* g3 = new QButtonGroup(this);

    // 将单选按钮放入不同组里
    g1->addButton(ui->radioButton);
    g1->addButton(ui->radioButton_2);

    g2->addButton(ui->radioButton_3);
    g2->addButton(ui->radioButton_4);

    g3->addButton(ui->radioButton_5);
    g3->addButton(ui->radioButton_6);
}

Widget::~Widget()
{
    delete ui;
}

